home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Programming / BlitzList / BlitzListFiles / ScreenOpen.asc < prev    next >
Encoding:
Text File  |  1998-05-31  |  2.8 KB  |  99 lines

  1. .OpenScreen
  2. WBenchToFront_
  3. pic$="BB2.title"
  4.   ;------- Open a screen & show the title pic ----------------
  5.   ; the screen is opened at the back of the display
  6.   ; when it is ready it is popped to the front
  7.   ; so you don't see it being made up
  8.  
  9.  
  10. ;=============== ENABLE THIS PART TO SEE TITLE PIC ==============
  11.   If Display=0
  12.     Gosub getScreenFont
  13.   EndIf
  14.  
  15.   If graphic$<>"ECS"
  16.     ILBMInfo pic$
  17.     pwidth.w=ILBMWidth
  18.     pheight.w=ILBMHeight
  19.     pdepth.b=ILBMDepth
  20.     BitMap 0,pwidth,pheight,pdepth
  21.     LoadBitMap 0,pic$,1
  22.     Dim Ptags.TagItem(7)
  23.     Ptags(0)\ti_Tag=#SA_DisplayID,$8000|$4
  24.     Ptags(1)\ti_Tag=#SA_Behind,True
  25.     Ptags(2)\ti_Tag=#SA_Depth,pdepth
  26.     Ptags(3)\ti_Tag=#SA_Width,pwidth
  27.     Ptags(4)\ti_Tag=#SA_Height,pheight
  28.     Ptags(5)\ti_Tag=#SA_Pens,?DriPens        ;List of 13 Dripens
  29.     Ptags(6)\ti_Tag=#TAG_DONE
  30.  
  31.     ScreenTags 1,"",&Ptags(0)
  32.  
  33.     Use Palette 1                          ;use it's colours
  34.     Free Palette 1                         ;free the palette
  35.     Window 2,0,0,pwidth,pheight,$1000|$800,"",0,0
  36.  
  37.     BitMaptoWindow 0,2                     ;put the pic in the window
  38.     Free BitMap 0
  39.     Use Window 2
  40.     AbsMouse pwidth,pheight                ;hide the pointer
  41.     ResetTimer
  42.     ShowScreen 1                           ;OK, show it now
  43.     Repeat
  44.     Until Ticks=>180
  45.   EndIf
  46.  
  47.  
  48. ;==================================================================
  49.  
  50.   ;------- now make the "Program's" screen --------------------
  51.   ; again, we make it up in back and pop to front when ready
  52. .OpenScreen2
  53.   If Display=0
  54.   newsetup.b=1
  55.   AbsMouse 320,200
  56.   Gosub Prefs                            ;you're first time, eh?
  57.   savemode.b=0
  58. EndIf
  59.  
  60.   Gosub getScreenFont
  61.   name$="BeatBox2"
  62.   scrname$="BeatBox2"
  63.   *fn=Addr IntuiFont (0)
  64.  
  65.   Dim SCRtags.TagItem(16)
  66.   SCRtags(0)\ti_Tag=#SA_DisplayID,Display
  67.   SCRtags(1)\ti_Tag=#SA_Overscan,Oscan
  68.   SCRtags(2)\ti_Tag=#SA_Depth,Dpth
  69.   SCRtags(3)\ti_Tag=#SA_Width,Width
  70.   SCRtags(4)\ti_Tag=#SA_Height,Height
  71.   SCRtags(5)\ti_Tag=#SA_AutoScroll,1         ;autoscroll is on!
  72.   SCRtags(6)\ti_Tag=#SA_Pens,?DriPens        ;List of 13 Dripens
  73.   SCRtags(7)\ti_Tag=#SA_Type,#PUBLICSCREEN
  74.   SCRtags(8)\ti_Tag=#SA_PubSig,0
  75.   SCRtags(9)\ti_Tag=#SA_PubTask,FindTask_(0)
  76.   SCRtags(10)\ti_Tag=#SA_Behind,1
  77.   SCRtags(11)\ti_Tag=#SA_PubName,&scrname$
  78.   SCRtags(12)\ti_Tag=#SA_Title,&name$
  79.   SCRtags(13)\ti_Tag=#SA_ShowTitle,0
  80.   SCRtags(14)\ti_Tag=#SA_Font,*fn
  81.   SCRtags(15)\ti_Tag=#TAG_DONE
  82.  
  83.  ;ScreenTags 0,"BeatBox2",&SCRtags(0)
  84.  
  85.   *MyScreen=OpenScreenTagList_(0,&SCRtags(0))
  86.  
  87.   If *MyScreen
  88.     PubScreenStatus_ *MyScreen,0  ; PUBLICSCREEN !
  89.     FindScreen 0,"BeatBox2"       ; so Blitz can use the screen
  90.   Else
  91.     WbToScreen 0
  92.     Window 0,0,0,1,1,$1000,"",0,0
  93.     CatchDosErrs
  94.     Request gm$,"Fatal Program Error!|Unable to Open Screen!|Program aborted","Damn!"
  95.     End
  96.   EndIf
  97.  
  98.   Use Palette 0
  99.